package com.xjy.headfirst.命令模式;

/**
 * decription:
 *
 * @author 辛纪元
 * @since 2022-07-07
 */

public class StereoOffWithCDCommand implements Command {

    Stereo stereo;

    public StereoOffWithCDCommand(Stereo stereo) {
        this.stereo = stereo;
    }

    @Override
    public void execute() {
        stereo.setVolume(0);
        stereo.off();
    }

    @Override
    public void undo() {
        stereo.on();
    }
}
